var mysql = require("mysql");
function getIndexData() {
  var connection = mysql.createConnection({
    host: "db-dev.cms.baic.ccyonyou.com", // 'localhost',
    user: "root",
    password: "ccyonyou",
    database: "cms_sysmanage",
  });

  connection.connect();

  return new Promise((res, rej) => {
    connection.query(
      'SELECT * FROM tm_user a WHERE a.USER_CODE = "R11010114"',
      function (err, rows, fields) {
        if (err) {
          throw err;
          rej(err);
        }
        res(rows);
        console.log("The solution is: ", rows);
      }
    );
  });
}
module.exports.getIndexData = getIndexData;
